<div class="technical main">
  <div class="technical-disclosure shadowbox">
    <div class="container-header">教育培训</div>
    <form name="queryForm" class="base-info pa-form-content">
      <div class="row-item">
        <div class="pa-form-control">
          <label class="name fl">培训主题：</label>
          <div class="pa-input fl">
            <input type="text"
              ng-model="techTraining.educationList.theme " />
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">施工队：</label>
          <div class="pa-input fl">
            <select name="crews" style="width: 240px;" 
              ng-model="techTraining.educationList.constructionTeamId">
              <option value=""></option>
              <optgroup ng-repeat="teamGroup in techTraining.teamWithOrgList"
                label="{{teamGroup.orgUnitName}}">
                <option ng-repeat="team in teamGroup.teamList"
                  value="{{team.teamId}}">
                  {{team.teamName}}
                </option>
              </optgroup>
            </select>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">项目部：</label>
          <div class="pa-input fl">
            <select name="department" class="pa-input-select"
              ng-model="techTraining.educationList.organizationDepartmentId">
              <option value=""></option>
              <option value="{{::item.orgUnitId}}"
                ng-repeat="item in techTraining.orgList">
                {{::item.orgUnitName}}
              </option>
            </select>
          </div>
        </div>
        <div class="pa-form-control">
          <label class="name fl">培训时间：</label>
          <div class="pa-input fl">
            <input type="text" name="startTime" ng-datepicker 
              ng-model="techTraining.educationList.startTime" />
            到
            <input type="text" name="endTime" ng-datepicker
              ng-model="techTraining.educationList.endTime" />
          </div>
        </div>          
      </div>
    </form>
    <div class="btn-outer-right">
      <a class="pa-btn" ng-click="techTraining.query(queryForm)">
        <i class="fa fa-search"></i>
        <span class="ml5">查询</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="techTraining.reset();">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <div class="pa-table-container shadowbox technical-detail">
    <div class="technical-list">
      <div class="list-title">
        <div class="title-item"
          authorization-btn="api/education/insertEducationInfo"
          ng-click="techTraining.openTrainingPlan()">   
          <img src="../../../assets/images/add-item-peixun.png" /> 
          <span>新增教育培训</span> 
        </div>
      </div>
      <div class="list-detail">
        <form class="base-info pa-form-content">
          <table class="pa-table">
            <thead>
              <tr>
                <th>主题</th>
                <th class="time-sequence">
                  <div>培训时间</div>
                  <div class="time-sequence-btn">
                    <div class="time-sequence-box"
                      ng-click="techTraining.up('train_time','0')">
                      <i class="fa fa-caret-up"></i>
                    </div>
                    <div class="time-sequence-box"
                      ng-click="techTraining.up('train_time','1')">
                      <i class="fa fa-caret-down"></i>
                    </div> 
                  </div>
                </th>
                <th>组织部门</th>
                <th>施工队</th>
                <th>参加人数</th>
                <th class="tech-operation">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="item in techTraining.technicalItemList">
                <td>{{item.theme}}</td>
                <td>{{item.trainTime}}</td>
                <td>{{item.organizationDepartmentName}}</td>
                <td>
                  <div ng-repeat="team in item.educationTrainConTeam">
                    {{team.constructionTeamName}}
                  </div>
                </td>
                <td>{{item.num}}</td>
                <td>
                  <div class="del"
                    authorization-btn="api/education/queryEducationInfo"
                    ng-click="techTraining.queryDisclosure(item)">
                    <i class="fa fa-street-view color"></i>
                    <span>查看</span>
                  </div>
                  <div class="del"
                    authorization-btn="api/education/queryEducationInfo"
                    ng-click="techTraining.editDisclosure(item)">
                    <i class="fa fa-pencil color"></i>
                    <span>编辑</span>
                  </div>
                  <div class="del"
                    authorization-btn="api/education/deleteEducationInfo"
                    ng-click="techTraining.delete(item.id)">
                    <i class="fa fa-trash color"></i>
                    <span>删除</span>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
          <div class="total-num">
            共计<span class="total-num-colorful">{{techTraining.paginationData.total}}</span>条
          </div>
          <!-- 分页 -->
          <div class="pagination-outer">
            <uib-pagination
              total-items="techTraining.paginationData.total"
              ng-model="techTraining.paginationData.pageNum"
              items-per-page="techTraining.paginationData.pageSize"
              ng-change="pageChange()"
              class="pagination-sm"
              boundary-link-numbers="true"
              max-size="5"
              next-text="下一页"
              previous-text="上一页"></uib-pagination>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<!-- 新增教育培训计划 -->
<script type="text/ng-template" id="openTrainingPlan">
  <div class="item-detail-dialog training-tech">  
    <div class="item-detail-dialog-header"> 
      <div class="title-txt">
        <span>新增教育培训计划</span> 
      </div>
    </div>  
    <div class="item-detail-dialog-content">
      <form name="tech" id="safe" role="form" novalidate>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>主题：</div> 
          <div class="right-value">
            <input type="text" name="theme" required
              ng-model="vm.techTrainList.theme" />
          </div> 
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.theme.$dirty) && tech.theme.$invalid">
            必填
          </span>
        </div>  
        <div class="row-item"> 
          <div class="fixed-left-label"><b>*</b>培训时间：</div>
          <div class="right-value">
            <input type="text" name="techTime" ng-datepicker required 
              ng-model="vm.techTrainList.trainTime" />  
          </div> 
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.techTime.$dirty) && tech.techTime.$invalid">
            必填
          </span>
        </div>
        <div class="row-item"> 
          <div class="fixed-left-label">学时：</div> 
          <div class="right-value">
            <input type="text" name="period"
              ng-model="vm.techTrainList.period" integer/> 
          </div>
          <span class="error-tip"          
            ng-show="(tech.$submitted || tech.period.$dirty) && tech.period.$error.integer">
            填数字
          </span>  
        </div>
        <div class="row-item">  
          <div class="fixed-left-label">地点：</div>  
          <div class="right-value"> 
            <input type="text" class="form-control" 
              ng-model="vm.techTrainList.place" />  
          </div>  
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>组织部门：</div>
          <div class="right-value">
            <select name="orgUnit" required 
              ng-model="vm.techTrainList.organizationDepartmentId"
              ng-options="item.orgUnitId as item.orgUnitName for item in orgs"></select>
          </div>
          <span class="error-tip"
            ng-show="(tech.$submitted || tech.orgUnit.$dirty) && tech.orgUnit.$invalid">
            必填
          </span>
        </div>  
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>参加人员：</div>
           <!-- 下拉多选-->
          <div class="right-value" id="take_part_workers">
            <button class="show_btn"
              ng-click="vm.isShowSelect=!vm.isShowSelect">
              请选择
            </button>
            <!--   <input type="text" style="width: 100%;padding: 0 10px;"> -->
            <div class="show_content" ng-show="vm.isShowSelect">
              <div ng-repeat="teamGroup in vm.teamWithOrgList">
                <label class="team-unit">{{teamGroup.orgUnitName}}</label>
                  <dl ng-repeat = "team in teamGroup.teamList"> 

                    <dd>
                      <input type="checkbox"
                        ng-model="team.checked"
                        ng-click="vm.checkAll(team,$event)"/>
                      <span class="team-construction"
                        ng-click="vm.showWorkers(team)">
                        {{team.teamName}}
                      </span>
                    </dd>
                    <dt ng-show="team.isShowWorker"
                      ng-repeat="worker in team.workerInfoBeanList">
                      <input type="checkbox" 
                        ng-model="worker.checked"
                        ng-change="vm.isChange(team.teamId);"/>
                      {{worker.workerName}}
                    </dt>
                  </dl>
              </div>
              <center ng-show="vm.teamWithOrgList.length == 0">暂无数据</center>
            </div>  
          </div>
          <span class="error-tip"
            ng-show="vm.showTeam">
            必填
          </span>
        </div>
        <common-attachment-upload
          component-id="cp2"
          pick-btn-id="avatar_attachment_picker"
          upload-url="{{fileUploadUrl.technicalDisclosure}}"
          file-list="vm.profilesToken"></avatar-attachment-upload> 
      </form>
    </div> 
    <div class="item-detail-dialog-footer"> 
      <a class="pa-btn" ng-click="vm.save(tech)">  
        <i class="fa fa-save"></i>  
        <span>确定</span>  
      </a> 
      <a class="pa-btn reset-btn" ng-click="closeThisDialog()"> 
        <i class="fa fa-times"></i> 
        <span>取消</span>
      </a> 
    </div>  
  </div>  
</script>

<!-- 查看教育培训信息 -->
<script type="text/ng-template" id="queryInfoDisclosure">
  <div class="item-detail-dialog training-tech">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>查看教育培训</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <form>
        <div class="row-item">
          <div class="fixed-left-label">主题：</div>
          <div class="right-value">            
            {{vm.disclosureList.theme}}
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">培训时间：</div>
          <div class="right-value">
            {{vm.disclosureList.trainTime}}
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">学时：</div>
          <div class="right-value">
            {{vm.disclosureList.period}}
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">组织部门：</div>
          <div class="right-value">
            {{vm.disclosureList.organizationDepartmentName}}
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">施工队：</div>
          <div class="right-value">
            <ul>
              <li class="con-team"
                ng-repeat = "item in vm.disclosureList.educationTrainConTeam">
                {{item.constructionTeamName}}
              </li>
            </ul>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">地点：</div>
          <div class="right-value">
            {{vm.disclosureList.place}}
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">参加人员：</div>
          <div class="right-value">
            <div style="cursor: pointer;"
              ng-click="vm.getMore()">
              查看更多
            </div>
            <div ng-show="vm.showContent"
              ng-repeat = "team in vm.disclosureList.educationTrainConTeam">
              <div style="float: left;margin: 10px"
                ng-repeat = "item in team.educationTrainWorker">
                {{item.workerName}}
              </div>
            </div>
          </div>
        </div>
        <!-- 显示文件列表 -->
        <div class="avatar-attachment-upload-outer"
          style="float: left;width: 100%;padding-left: 41px;margin-top: 0;">
          <div class="file-list-outer">
            <div class="file-item" ng-repeat="item in vm.disclosureList.fileBeans">
              <span class="upload-file-name">{{item.fileName}}</span>
              <a class="pa-btn" ng-click="vm.preview(item, archiveDetail)">预览</a>
              <a class="pa-btn file-del-btn" target="_blank" 
                ng-href="{{vm.getDownloadSrc(item)}}">
                  下载
              </a>
            </div>
          </div>
        </div> 
      </form>
    </div>
  </div>
</script>

<!--编辑教育培训列表培训信息-->
<script type="text/ng-template" id="alterInfoDisclosure">
  <div class="item-detail-dialog training-tech">
    <div class="item-detail-dialog-header">
      <div class="title-txt">
        <span>编辑教育培训</span>
      </div>
    </div>
    <div class="item-detail-dialog-content">
      <form name="editInfo" id="editInfo" role="form" novalidate>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>主题：</div>
          <div class="right-value">
            <input type="text" name="trainTheme" required  
              ng-model="vm.disclosureList.theme" />
          </div>
          <span class="error-tip"
            ng-show="(editInfo.$submitted || editInfo.trainTheme.$dirty) && editInfo.trainTheme.$invalid">
            必填
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>培训时间：</div>
          <div class="right-value">
            <input ng-datepicker name="trainTime" required 
              ng-model="vm.disclosureList.trainTime" />
          </div>
          <span class="error-tip"
            ng-show="(editInfo.$submitted || editInfo.trainTime.$dirty) && editInfo.trainTime.$invalid">
            必填
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">学时：</div>
          <div class="right-value">
            <input type="text" name="period"
              ng-model="vm.disclosureList.period" integer/>
          </div>
          <span class="error-tip"          
            ng-show="(editInfo.$submitted || editInfo.period.$dirty) && editInfo.period.$error.integer">
            填数字
          </span>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">组织部门：</div>
          <div class="right-value">
            <input type="text" disabled
              ng-model="vm.disclosureList.organizationDepartmentName" />
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">施工队：</div>
          <div class="right-value">
            <ul>
              <li class="con-team"
                ng-repeat = "item in vm.disclosureList.educationTrainConTeam">
                {{item.constructionTeamName}}
              </li>
            </ul>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">地点：</div>
          <div class="right-value">
            <input type="text"
              ng-model="vm.disclosureList.place" />
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label"><b>*</b>参加人员：</div>
           <!-- 下拉多选-->
          <div class="right-value" id="take_part_workers">
            <button class="show_btn"
              ng-click="vm.isShowSelect=!vm.isShowSelect">
              请选择
            </button>
            <div class="show_content" ng-show="vm.isShowSelect">
              <div ng-repeat="teamGroup in vm.teamWithOrgList">
                <label class="team-unit">{{teamGroup.orgUnitName}}</label>
                  <dl ng-repeat = "team in teamGroup.teamList"> 

                    <dd>
                      <input type="checkbox"
                        ng-model="team.checked"
                        ng-click="vm.checkAll(team,$event)"/>
                      <span class="team-construction"
                        ng-click="vm.showWorkers(team)">
                        {{team.teamName}}
                      </span>
                    </dd>
                    <dt ng-show="team.isShowWorker"
                      ng-repeat = "worker in team.workerInfoBeanList">
                      <input type="checkbox"
                        ng-change="vm.isChange(team.teamId);"
                        ng-model="worker.checked" />
                      {{worker.workerName}}
                    </dt>

                  </dl>
              </div>
              <center ng-show="vm.teamWithOrgList.length == 0">暂无数据</center>
            </div>  
          </div>
          <span class="error-tip"
            ng-show="vm.showTeam">
            必填
          </span>
        </div>
        <!-- 上传文件 -->
        <common-attachment-upload
          component-id="cp2"
          file-type="file"
          pick-btn-id="avatar_attachment_picker"
          upload-url="{{fileUploadUrl.technicalDisclosure}}"
          file-list="vm.disclosureList.fileBeans"></common-attachment-upload>
      </form>
    </div>
    <div class="item-detail-dialog-footer">
      <a class="pa-btn"
        authorization-btn="api/education/updateEducationInfo"
        ng-click="vm.submit(editInfo)">
        <i class="fa fa-save"></i>
        <span>确定</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="closeThisDialog()">
        <i class="fa fa-times"></i>
        <span>取消</span>
      </a>
    </div>
  </div>
</script>